<HTML>
<HEAD>
<TITLE>JavaScript Source Code 3000:  Navigation:  Change 2 Frames Menu(Source)</TITLE>
<META HTTP-EQUIV="JavaScript Source Code 3000" CONTENT="no-cache">
<META NAME="description" CONTENT="Loads two different pages in two other frames just by selecting an option in a pulldown menu.  Just define each menu option with both of the frame names and the web address to load and you're set. Wow!">
</HEAD>

<BODY BGCOLOR=#ffffff vlink=#0000ff>

<BR>
<center>
<table width="600" cellpadding="0" cellspacing="10">
<tr>
<td width="468" align="center">

	
</td>
<td width="120" align="center">

	
</td>
</tr>
</table>
<BR>
<BR>
<BASEFONT SIZE=3>
  <FONT SIZE=6>
<B><FONT SIZE="+2" FACE="Helvetica,Arial" ALIGN=RIGHT COLOR="#0000FF">
<b><A HREF="../index.htm" /" TARGET="_top">
Home</A> </b><img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}"> <b><A HREF="index.htm" /navigation/"><font color="#FF0000">Navigation</font></A> </b>
<img src="../img/arrow.gif" /img/arrow.gif" height=13 width=7 border=0 alt="}"> <FONT COLOR="#006666">Change 2 Frames Menu</FONT></b></FONT><BR>
</B><BR>
  </FONT>
<TABLE BORDER=0 WIDTH=500 CELLPADDING=3 CELLSPACING=0>
<tr><td><font FACE=" helvetica,arial,geneva">
<br>
<br>
<!--  Description  -->
Loads two different pages in two other frames just by selecting an option in a pulldown menu.  Just define each menu option with both of the frame names and the web address to load and you're set. Wow!<br><hr>
</td></tr>
</table>
<!--  Demonstration -->
<CENTER>[ <a href="javascript:if(confirm('http://javascript.internet.com/navigation/change-2-frames-menu-demo.html  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?'))window.location='http://javascript.internet.com/navigation/change-2-frames-menu-demo.html'" /navigation/change-2-frames-menu-demo.html" target="_top">see 'Change 2 Frames Menu' again</A> ]</CENTER>
<P>
<BR>
<P>
<a name="source">
<TABLE BORDER=0 WIDTH=500 CELLPADDING=3 CELLSPACING=0>
<tr><td BGCOLOR=yellow><font FACE="helvetica,arial,geneva"><b>JavaScript Source Code 3000:  Navigation:  Change 2 Frames Menu (Frameset)</b>
<p>Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as NotePad or SimpleText) and save (Control-s or Apple-s).  The script is yours!<br><br></font></td></tr>
<tr><td BGCOLOR=yellow ALIGN=CENTER>
<form NAME="copy">

<DIV align="center">
<input type=button value="Highlight All" onClick="javascript:this.form.txt.focus();this.form.txt.select();">&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="text" NAME="total" VALUE="Script Size:  0.70 KB  " size="32">
</DIV>

<textarea NAME="txt" ROWS=20 COLS=75 WRAP=VIRTUAL>

&lt;!-- TWO STEPS TO INSTALL CHANGE 2 FRAMES (FRAMESET):

   1.  Copy the frameset code into your HTML document
   2.  Be sure to give each frame a unique 'name' --&gt;

&lt;!-- STEP ONE:  Copy this FRAMESET code into your FRAMESET page  --&gt;

&lt;html&gt;

&lt;head&gt;

&lt;title&gt;Your Site's Title Here&lt;/title&gt;

&lt;/head&gt;

&lt;frameset cols="160,*"&gt;

  &lt;frame src="http://www.yoursite.com/links-page.html"&gt;

  &lt;frameset rows="50%,50%"&gt; 

    &lt;frame src="http://www.yoursite.com/top-page.html" name="Frame_A"&gt;

    &lt;frame src="http://www.yoursite.com/bottom-page.html" name="Frame_B"&gt;

  &lt;/frameset&gt;

&lt;/frameset&gt;

&lt;/html&gt;

&lt;!-- STEP TWO:  Give each frame a name!  (frame name="left") --&gt;

 

&lt;!-- Script Size:  0.70 KB  --&gt;</textarea><br></td></tr></form>

<tr><td BGCOLOR=yellow><font FACE="helvetica,arial,geneva"><b>JavaScript Source Code 3000:  Navigation:  Change 2 Frames Menu (Links Page)</b>
<p>Simply click inside the window below, use your cursor to highlight the script, and copy (type Control-c or Apple-c) the script into a new file in your text editor (such as NotePad or SimpleText) and save (Control-s or Apple-s).  The script is yours!<br><br></font></td></tr>
<tr><td BGCOLOR=yellow ALIGN=CENTER>
<form NAME="copy2">

<DIV align="center">
<input type=button value="Highlight All" onClick="javascript:this.form.txt.focus();this.form.txt.select();">&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT TYPE="text" NAME="total" VALUE="Script Size:  0.96 KB  " size="24">
</DIV>

<textarea NAME="txt" ROWS=20 COLS=75 WRAP=VIRTUAL>

&lt;!-- TWO STEPS TO INSTALL CHANGE 2 FRAMES (LINKS PAGE):

   1.  Put the first code in the HEAD of your links page
   2.  Copy the links code into the BODY of your links page --&gt;

&lt;!-- STEP ONE: Put this code into the HEAD of your links document  --&gt;

&lt;HEAD&gt;


&lt;SCRIPT LANGUAGE="JavaScript"&gt;

&lt;!-- Begin

function checkMenu(param) {
if (param != "'','','',''") 
eval('loadFrames(' + param + ')');
}
function loadFrames(frame1,page1,frame2,page2) {
eval("parent."+frame1+".location='"+page1+"'");
eval("parent."+frame2+".location='"+page2+"'");
}
// End --&gt;

&lt;/script&gt;

&lt;/head&gt;

&lt;!-- STEP TWO:  Change all the links to the BODY of your links page  --&gt;


&lt;BODY&gt;

Our Links...&lt;br&gt;
&lt;br&gt;
Click a menu option below to get started!
&lt;br&gt;
&lt;br&gt;

&lt;form&gt;
&lt;select name=sitemenu onChange="checkMenu(this.options[this.selectedIndex].value)"&gt;
&lt;option value="'','','',''"&gt;Please select an item below:&lt;/option&gt;
&lt;option value="'Frame_A','http://javascript.internet.com/feedback.html', 'Frame_B','http://javascript.internet.com/toc.html'"&gt;Load Feedback & Table of Contents Pages&lt;/option&gt;
&lt;option value="'Frame_A','http://e-newsletters.internet.com/javascriptsource.html', 'Frame_B','http://forum.javascriptsource.com'"&gt;Load Newsletter & JavaScript Forum Pages&lt;/option&gt;
&lt;/select&gt;
&lt;/form&gt;

&lt;a href="no-frames-home.html" target="_top"&gt;Go to site without frames&lt;/a&gt;&lt;/center&gt;

 

&lt;!-- Script Size:  0.96 KB  --&gt;</textarea><br><font FACE="helvetica,arial,geneva"></font></td></tr>

</table>
</form>

	

<p>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function getCookieVal (offset) {
var endstr = document.cookie.indexOf(";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = "/"; //(argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}

var emailcookie = GetCookie('email_address');
if (emailcookie == null) {
emailcookie = 'your email here';
}

function chk(email, formname)
{
invalid = "";

if (!email)
invalid = "No email address found!  Try reloading the page then use the 'email a script' feature again.";

else {

if ( (email.indexOf("@") == -1) || (email.indexOf(".") == -1) ) 
invalid += "\n\nInvalid email address.  Your email address is missing an '@' sign and a '.' in the domain name (like '.com').  Please check your address then submit again.";

if (email.indexOf("youremailhere") > -1)
invalid += "\n\nInvalid email address.  Make sure your email address included your username, the '@' sign, and the domain name (like '.com').";

if (email.indexOf("\\") > -1) 
invalid += "\n\nEmail address contains an invalid back-slash (\\) character.  Remove the character and submit again.";

if (email.indexOf("/") > -1) 
invalid += "\n\nEmail address contains an invalid forward-slash (/) character.  Remove the character and submit again.";

if (email.indexOf("'") > -1) 
invalid += "\n\nEmail address contains an invalid apostrophe (') character.  Remove the character and submit again.";

if (email.indexOf("zaz.com.br") > -1) 
invalid += "\n\nPlease do not use an email address that has an autoresponder set up for it.  Thanks.";

if (email.indexOf("!") > -1) 
invalid += "\n\nEmail address contains an invalid exclamation point (!) character.  Remove the character or correct the email address then submit again.";

if ( (email.indexOf(",") > -1) || (email.indexOf(";") > -1) )
invalid += "\n\nPlease only enter one email address in the box at a time.  Remove the extra addresses and submit again.";

if (email.indexOf("?subject") > -1) 
invalid += "\n\nPlease do not add '?subject=...' to your email address.  Scriptbot will send you the script with a pre-defined subject already.  Please remove the '?subject=...' from your email address and submit again.";
}

if (invalid == "")
   {
   var largeExpDate = new Date();
   largeExpDate.setTime(largeExpDate.getTime() + (31 * 24 * 3600 * 1000));
   SetCookie('email_address', email, largeExpDate);
   if (formname == "scriptbot")
      {
      page = "http://javascript.internet.com/sent.html?" + email;
      window.open(page, "AdWindow", "width=650,height=200");
      }
   return true;
}
else 
   { 
   alert("Oops, something is wrong...." + invalid);
   return false;
   }
}

function updateNewsletters() {
with (document.forms["newslettersignup"]) {
emailStr = email.value;
var emailPat=/^(.+)@(.+)$/;
var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"; // remove   ( ) < > @ , ; : \ " . [ ]    */
var validChars="\[^\\s" + specialChars + "\]";
var quotedUser="(\"[^\"]*\")";
var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;
var atom=validChars + '+';
var word="(" + atom + "|" + quotedUser + ")";
var userPat=new RegExp("^" + word + "(\\." + word + ")*$");
var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");
var matchArray=emailStr.match(emailPat);
if (matchArray==null) {
alert("Email address seems incorrect (check @ and .'s)");
return false;;
}
var user=matchArray[1];
var domain=matchArray[2];
if (user.match(userPat)==null) {
alert("The username doesn't seem to be valid.");
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
for (var i=1;i<=4;i++) {
if (IPArray[i]>255) {
alert("Destination IP address is invalid!");
return false;
      }
   }
}
var domainArray=domain.match(domainPat);
if (domainArray==null) {
alert("The domain name doesn't seem to be valid.");
return false;
}
var atomPat=new RegExp(atom,"g");
var domArr=domain.match(atomPat);
var len=domArr.length;
if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>3) {
alert("The address must end in a three-letter domain, or two letter country.");
return false;
}
if (len<2) {
var errStr="This address is missing a hostname!";
alert(errStr);
return false;
}
List_Name.value = newsletter.options[newsletter.selectedIndex].value
		+ nltype.options[nltype.selectedIndex].value;

   var largeExpDate = new Date();
   largeExpDate.setTime(largeExpDate.getTime() + (31 * 24 * 3600 * 1000));
   SetCookie('email_address', emailStr, largeExpDate);

return true;
   }
}
// End -->
</script>

<p>
<center>

<table cellpadding=0 cellspacing=0 border=0 width="620">
<tr>
<td align=left>

